<?php

/**
 # com_jvframwork - JV Framework
 # @version		1.5.x
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/

// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();

/**
 * Renders a list element
 *
 * @package 	Joomla.Framework
 * @subpackage	Parameter
 * @since		1.5
 */
 

class JElementGfont extends JElement {
    /**
     * Element type
     *
     * @access	protected
     * @var		string
     */
    var $_name = 'Gfont';
  
    function fetchElement($name, $value, &$node, $control_name) {
        require_once (JPATH_COMPONENT .DS. 'libraries'. DS . 'addons'. DS . 'gfont' . DS . 'gfont.php');
        $fontlist =  Gfont::getFont();  
        
        if (! $node->attributes ( 'hide_none' )) {
    		$font [] = JHTML::_ ( 'select.option', '', '- ' . JText::_ ( 'Do not use' ) . ' -' );
    	}		
        
        if (is_array ( $fontlist )) {
    		foreach ( $fontlist as $val => $fname ) {				
    			$font [] = JHTML::_ ( 'select.option', $val, $fname );
    		}
    	} 
        
        return JHTML::_('select.genericlist',  $font, ''.$control_name.'['.$name.']', '', 'value', 'text', $value, $control_name.$name);
	
    }
}